{% extends 'base.html' %}
{% block title %}待办事项程序{% endblock %}

{% block content %}
<div id="todo-add">
  <form action="{{ url_for('add') }}" method="post">
    <textarea rows="5" cols="50" placeholder="请输入待办事项" name="content"></textarea>
    <button type="submit">添加</button>
  </form>
</div>
<hr>
<div id="todo-list">
  <table style="border: 1px solid black">
    <tr>
{#      <th>序号</th>#}
      <th>状态</th>
      <th>内容</th>
      <th>删除</th>
      <th>完成</th>
    </tr>
    {% for todo in todo_list %}
    <tr>
      {% if todo.status == 0 %}
        <td>未完成</td>
      {% elif todo.status == 1 %}
        <td>已完成</td>
      {% endif %}
{#      <td>{{ loop.index }}</td>#}
{#      <td>{{ todo.status }}</td>#}
      <td>{{ todo.content }}</td>
      <td><a href="{{ url_for('delete', content=todo.content) }}">×</a></td>
      <td><a href="#">√</a></td>
{#      {{ todo.id }}#}
    </tr>
    {% endfor %}


{#    <tr>#}
{#      <td>1</td>#}
{#      <td>已完成</td>#}
{#      <td>早上记得打卡</td>#}
{#      <td><a href="">×</a></td>#}
{#      <td><a href="">√</a></td>#}
{#    </tr>#}
{#    <tr>#}
{#      <td>2</td>#}
{#      <td>未完成</td>#}
{#      <td>记得双十二抢购</td>#}
{#      <td><a href="#">×</a></td>#}
{#      <td><a href="#">√</a></td>#}
{#    </tr>#}
  </table>
</div>
{% endblock %}
